package com.sumainfor.pc.dev.controller;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.dev.service.PopularHousingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 热门房源
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-05-09 15:51
 **/
@Controller
@RequestMapping("/popularHousing")
public class PopularHousingController {

    @Autowired
    PopularHousingService popularHousingService;

    /**
    * <p>
    * 获取热门房源(根据传入参数获得是否是首页展示)
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @GetMapping("/getIfPopularList")
    public JsonResult getIfPopularList(@RequestParam Map<String,Object> params){
        return popularHousingService.getIfPopularList(params);
    }

    /**
    * <p>
    * 保存热门房源
    * </p>
    *
    * @author: zhoucong
    * @since:
    */
    @ResponseBody
    @PostMapping("/savePopular")
    public JsonResult savePopular(@RequestBody Map<String,Object> params){
        return popularHousingService.savePopular(params);
    }

}
